import request from "@/utils/request";

// 查询字典数据列表
export function listData(query) {
  return request({
    url: "/v1/system/dictData/list",
    method: "get",
    params: query,
  });
}

// 查询字典数据详细
export function getData(dict_code) {
  return request({
    url: "/v1/system/dictData/getByDictCode",
    method: "get",
    params:{dict_code}
  });
}

// 根据字典类型查询字典数据信息
export function getDicts(dict_type) {
  return request({
    url: "/v1/system/dictData/type",
    method: "get",
    params: { dict_type },
  });
}

// 新增字典数据
export function addData(data) {
  return request({
    url: "/v1/system/dictData/add",
    method: "post",
    data: data,
  });
}

// 修改字典数据
export function updateData(data) {
  return request({
    url: "/v1/system/dictData/update",
    method: "put",
    data: data,
  });
}

// 删除字典数据
export function delData(dict_code) {
  return request({
    url: "/v1/system/dictData/delete",
    method: "post",
    data: { dict_code },
  });
}


// 删除字典数据
export function delDataByIds(ids) {
  return request({
    url: "/v1/system/dictData/deleteByIds",
    method: "post",
    data: { ids },
  });
}
